import math

sieve = [True] * 10000000
i = 2
while i < 3163 :
    if sieve[i] :
        j = i + i
        while j < len(sieve) :
            sieve[j] = False
            j += i
    i += 1
    
"""
print "[",
count = 0
for i in range(0, len(sieve)) :
    if sieve[i] :
        print i, ",",
        count += 1

print "]"
print count
"""
